import request from '@/utils/request'

// 查询老人健康情况列表
export function listCondition(query) {
  return request({
    url: '/system/condition/list',
    method: 'get',
    params: query
  })
}

// 查询老人健康情况详细
export function getCondition(id) {
  return request({
    url: '/system/condition/' + id,
    method: 'get'
  })
}

// 新增老人健康情况
export function addCondition(data) {
  return request({
    url: '/system/condition',
    method: 'post',
    data: data
  })
}

//新增老人用药
export function addmedication(data) {
  return request({
    url: '/system/medication',
    method: 'post',
    data: data
  })
}
//新增老人住院
export function addhospitalization(data) {
  return request({
    url: '/system/hospitalization',
    method: 'post',
    data: data
  })
}
//删除老人用药
export function delmedication(id) {
  return request({
    url: '/system/medication/' + id,
    method: 'delete'
  })
}

//删除老人住院
export function delhospitalization(id) {
  return request({
    url: '/system/hospitalization/' + id,
    method: 'delete'
  })
}
// 修改老人住院
export function updatehospitalization(data) {
  return request({
    url: '/system/hospitalization',
    method: 'put',
    data: data
  })
}
// 修改药
export function updatemedication(data) {
  return request({
    url: '/system/medication',
    method: 'put',
    data: data
  })
}
// 修改老人健康情况
export function updateCondition(data) {
  return request({
    url: '/system/condition',
    method: 'put',
    data: data
  })
}

// 删除老人健康情况
export function delCondition(id) {
  return request({
    url: '/system/condition/' + id,
    method: 'delete'
  })
}
